home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / tutorials / custEducation / opengl1 / include / auxToolkit.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  3.3 KB  |  122 lines

  1. /*
  2.  * Copyright 1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17.  
  18.  
  19. /**************************************************************************
  20.  *    Toolkit Window Structures
  21.  **************************************************************************/
  22.  
  23. #define DATA_ELEMENTS         4
  24.  
  25.  
  26. /**************************************************************************
  27.  *    Toolkit Window Structures
  28.  **************************************************************************/
  29.  
  30. typedef struct _AUX_EVENTREC {
  31.  
  32.     GLint        event;
  33.     GLint        data[DATA_ELEMENTS];
  34.  
  35. }    AUX_EVENTREC;
  36.  
  37.  
  38. typedef struct _AUX_COLORREC {
  39.  
  40.     GLint        index;
  41.     GLfloat      r;
  42.     GLfloat      g;
  43.     GLfloat      b;
  44.  
  45. }    AUX_COLORREC;
  46.  
  47. /*
  48. ** ToolKit Window Types
  49. */
  50.  
  51. #define AUX_DIRECT    0
  52. #define AUX_INDIRECT    4
  53.  
  54. /* 
  55. ** Window Masks
  56. */
  57.  
  58. #define AUX_WIND_IS_RGB(x)    (((x) & AUX_INDEX) == 0)
  59. #define AUX_WIND_IS_INDEX(x)    (((x) & AUX_INDEX) != 0)
  60. #define AUX_WIND_IS_SINGLE(x)    (((x) & AUX_DOUBLE) == 0)
  61. #define AUX_WIND_IS_DOUBLE(x)    (((x) & AUX_DOUBLE) != 0)
  62. #define AUX_WIND_IS_INDIRECT(x)    (((x) & AUX_INDIRECT) != 0)
  63. #define AUX_WIND_IS_DIRECT(x)    (((x) & AUX_INDIRECT) == 0)
  64. #define AUX_WIND_HAS_ACCUM(x)    (((x) & AUX_ACCUM) != 0)
  65. #define AUX_WIND_HAS_ALPHA(x)    (((x) & AUX_ALPHA) != 0)
  66. #define AUX_WIND_HAS_DEPTH(x)    (((x) & AUX_DEPTH) != 0)
  67. #define AUX_WIND_HAS_STENCIL(x)    (((x) & AUX_STENCIL) != 0)
  68.  
  69. /*
  70. ** Color Macros
  71. */
  72.  
  73. enum {
  74.     AUX_BLACK = 0,
  75.     AUX_RED,
  76.     AUX_GREEN,
  77.     AUX_YELLOW,
  78.     AUX_BLUE,
  79.     AUX_MAGENTA,
  80.     AUX_CYAN,
  81.     AUX_WHITE
  82. };
  83.  
  84. extern float auxRGBMap[8][3];
  85.  
  86. #define AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
  87.                    glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))
  88.  
  89. /*
  90. ** RGB Image Structure
  91. */
  92.  
  93. typedef struct _AUX_RGBImageRec {
  94.     GLint sizeX, sizeY;
  95.     unsigned char *data;
  96. } AUX_RGBImageRec;
  97.  
  98. /**************************************************************************
  99.  *    Toolkit Event Data Indices
  100.  **************************************************************************/
  101.  
  102. #define AUX_WINDOWX           0
  103. #define AUX_WINDOWY           1
  104.  
  105. #define AUX_MOUSEX            0
  106. #define AUX_MOUSEY            1
  107. #define AUX_MOUSESTATUS       3
  108.  
  109. #define AUX_KEY               0
  110. #define AUX_KEYSTATUS         1
  111.  
  112.  
  113. /**************************************************************************
  114.  *    Toolkit 'Get' and 'Set' Function Defines
  115.  **************************************************************************/
  116.  
  117. #define AUX_FD                1     /* return fd ( GLint ) */
  118. #define AUX_COLORMAP          3     /* pass buf of r, g, and b, ( GLchar ) */
  119. #define AUX_GREYSCALEMAP      4
  120. #define AUX_FOGMAP            5     /* pas fog and color bits ( GLint ) */
  121. #define AUX_ONECOLOR          6     /* pass index r, g, and b ( GLin */
  122.